#include <REGX52.H>

void Time0_Init()
{
	TMOD |= 0x01;
	TH0 = 0xfc;
	TL0 = 0x66;
	ET0 = 1;
	EA = 1;
	TR0 = 1;
}

void main()
{
	Time0_Init();
	while(1)
	{
		
	}
}

void time0() interrupt 1
{
	static int count = 0;
	TH0 = 0xfc;
	TL0 = 0x66;
	
	count++;
	if(count == 20)
	{
		count = 0;
		P2 = ~P2;
	}
}